<!DOCTYPE html>
<html>
<head th:include="common/header_css::header('霸王餐小程序后台管理-商品信息','%mfile%datepicker%summernote')"></head>
<!--<head th:include="common/header_css::header('霸王餐小程序后台管理-商户管理')"></head>-->
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div th:replace="common/toolbar::toolbar('商品信息管理')"></div>
        <div th:replace="common/search::search('%add')"></div>
        <!-- End Panel Basic -->
    </div>

    <!--添加GoodsSku模态框-->
    <div id="modal-add-form" class="modal fade" aria-hidden="true">
        <div class="modal-dialog" style="width: 800px;">
            <div class="modal-content">
                <div class="modal-body">
                    <div class="row">
                        <h3 class="m-t-none m-b">商品信息添加</h3>
                        <div class="col-sm-12">
                            <div class="ibox float-e-margins">
                                <div class="ibox-content">
                                    <form id="aform" method="post" class="form-horizontal" action="add"
                                          onsubmit="return checkAdd()">

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品分类 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="cid"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品卖点</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="characteristic"
                                                               type="text" maxlength="255"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">物流模板编号</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="logisticsId"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">最低价</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="minPrice"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品原价 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="price"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">实际售价 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="saleprice"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品名 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="name"
                                                               required
                                                               type="text" maxlength="255"/>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">收藏数</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="numberFav"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">好评数</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="numberGrade"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">订单数</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="numberOrders"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">销量数</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="numberSale"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">排序</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="paixu"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">起售时间
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input type="date" class="form-control selectData" readonly
                                                               id="dateStart" name="dateStart">
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">停售时间
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input type="date" class="form-control selectData" readonly
                                                               id="dateEnd" name="dateEnd">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">规格</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="propertyIds"
                                                               type="text" maxlength="255"/>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">推荐指数</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="recommend"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">

                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">启用状态 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" class="js-switch" name="state"
                                                               value="-1">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">总库存数</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="stores"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品视频</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="videoId"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">可扣除优惠券 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="maxUseCoupon"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">分享奖励类型 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <select class="form-control" name="shareBonusType">
                                                            <option value="0">无奖励</option>
                                                            <option value="1">送积分</option>
                                                            <option value="2">送现金</option>
                                                            <option value="3">送优惠券</option>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">奖励额 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="shareMount"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品二维码</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="barcode"
                                                               type="text" maxlength="300"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品重量：KG</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="weight"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">浏览量</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="views"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">营销活动</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="eventId"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">是否支持会员卡交易</label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" class="js-switch" name="isMember"
                                                               value="-1">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">是否支持积分抵扣交易</label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" class="js-switch" name="isJifen"
                                                               value="-1">
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">是否支持优惠券交易 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" class="js-switch" name="isCoupon"
                                                               value="-1">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">是否热推 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" class="js-switch" name="isRecommended"
                                                               value="-1">
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">可扣除积分 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="maxUseJifen"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">是否含有sku产品 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="hasSku"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>


                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">产品类型 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <select class="form-control" name="gtype">
                                                            <option value="1">实物产品</option>
                                                            <option value="2">虚拟产品</option>
                                                            <option value="3">预约到店服务</option>
                                                            <option value="4">预约上门服务</option>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">介绍</label>
                                                    <div class="col-sm-10">
                                                        <div id="sninfo" class="summernote"></div>
                                                        <input type="hidden" id="info" name="info"/>

                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">商品主图</label>
                                                    <div class="col-sm-10">
                                                        <input id="mfile" name="mfile" type="file" class="file"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">包装清单</label>
                                                    <div class="col-sm-10">
                                                        <div id="snpackinglist" class="summernote"></div>
                                                        <input type="hidden" id="packinglist" name="packinglist"/>

                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">售后服务</label>
                                                    <div class="col-sm-10">
                                                        <div id="snafterservice" class="summernote"></div>
                                                        <input type="hidden" id="afterservice" name="afterservice"/>

                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">产品介绍</label>
                                                    <div class="col-sm-10">
                                                        <div id="snintroduction" class="summernote"></div>
                                                        <input type="hidden" id="introduction" name="introduction"/>

                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <div class="col-sm-4 col-sm-offset-2">
                                                <button class="btn btn-primary" type="submit">保存内容</button>
                                                <button data-toggle="modal" type="button" class="btn btn-white"
                                                        href="#modal-add-form">取消
                                                </button>
                                            </div>
                                        </div>
                                        <input id="hidpic" name="pic" type="hidden" value=""
                                        />
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--修改GoodsSku模态框-->
    <div id="modal-form" class="modal fade" aria-hidden="true">
        <div class="modal-dialog" style="width: 800px;">
            <div class="modal-content">
                <div class="modal-body">
                    <div class="row">
                        <h3 class="m-t-none m-b">商品信息修改</h3>
                        <div class="col-sm-12">
                            <div class="ibox float-e-margins">
                                <div class="ibox-content">
                                    <form id="mform" method="post" class="form-horizontal" action="modify"
                                          onsubmit="return checkModify()">
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品分类 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="cid" name="cid"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品卖点</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="characteristic"
                                                               name="characteristic"
                                                               type="text" maxlength="255"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">物流模板编号</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="logisticsId" name="logisticsId"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">最低价</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="minPrice" name="minPrice"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品原价 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="price" name="price"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">实际售价 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="saleprice" name="saleprice"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品名 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="name" name="name"
                                                               required
                                                               type="text" maxlength="255"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">收藏数</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="numberFav" name="numberFav"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">好评数</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="numberGrade" name="numberGrade"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">订单数</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="numberOrders"
                                                               name="numberOrders"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">销量数</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="numberSale" name="numberSale"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">排序</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="paixu" name="paixu"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">起售时间</label>
                                                    <div class="col-sm-8">
                                                        <input type="text" class="form-control selectData" readonly
                                                               id="dateStart2" name="dateStart">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">停售时间</label>
                                                    <div class="col-sm-8">
                                                        <input type="text" class="form-control selectData" readonly
                                                               id="dateEnd2" name="dateEnd">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">规格</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="propertyIds" name="propertyIds"
                                                               type="text" maxlength="255"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">推荐指数</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="recommend" name="recommend"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">

                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">启用状态 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" id="state" name="state" value="-1">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">总库存数</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="stores" name="stores"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品视频</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="videoId" name="videoId"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">可扣除优惠券 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="maxUseCoupon"
                                                               name="maxUseCoupon"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">分享奖励类型 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <select class="form-control" name="shareBonusType"
                                                                id="shareBonusType">
                                                            <option value="0">无奖励</option>
                                                            <option value="1">送积分</option>
                                                            <option value="2">送现金</option>
                                                            <option value="3">送优惠券</option>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">奖励额 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="shareMount" name="shareMount"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品二维码</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="barcode" name="barcode"
                                                               type="text" maxlength="300"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商品重量：KG</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="weight" name="weight"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">浏览量</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="views" name="views"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">商家id *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="mid" name="mid"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">营销活动</label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="eventId" name="eventId"
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">是否支持会员卡交易</label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" id="isMember" name="isMember" value="-1">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">是否支持积分抵扣交易</label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" id="isJifen" name="isJifen" value="-1">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">是否支持优惠券交易 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" id="isCoupon" name="isCoupon" value="-1">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">是否热推 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" id="isRecommended" name="isRecommended"
                                                               value="-1">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">可扣除积分 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="maxUseJifen" name="maxUseJifen"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">是否含有sku产品 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="hasSku" name="hasSku"
                                                               required
                                                               type="number"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                        </div>
                                        <div class="row">
                                        </div>
                                        <div class="row">
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">产品类型 *
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <select class="form-control" name="gtype" id="gtype">
                                                            <option value="1">实物产品</option>
                                                            <option value="2">虚拟产品</option>
                                                            <option value="3">预约到店服务</option>
                                                            <option value="4">预约上门服务</option>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">介绍</label>
                                                    <div class="col-sm-10">
                                                        <div id="sninfo2" class="summernote"></div>
                                                        <input type="hidden" id="info2" name="info"
                                                        />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">商品主图</label>
                                                    <div class="col-sm-10">
                                                        <img id="previewPic" src='' class='file-preview-image' alt=''
                                                             title=''
                                                             style="width: 100px;height: 100px;"/>
                                                        <input id="mfile2" name="mfile" type="file" class="file"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">包装清单</label>
                                                    <div class="col-sm-10">
                                                        <div id="snpackinglist2" class="summernote"></div>
                                                        <input type="hidden" id="packinglist2" name="packinglist"
                                                        />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">售后服务</label>
                                                    <div class="col-sm-10">
                                                        <div id="snafterservice2" class="summernote"></div>
                                                        <input type="hidden" id="afterservice2" name="afterservice"
                                                        />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">产品介绍</label>
                                                    <div class="col-sm-10">
                                                        <div id="snintroduction2" class="summernote"></div>
                                                        <input type="hidden" id="introduction2" name="introduction"
                                                        />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <div class="col-sm-4 col-sm-offset-2">
                                                <button class="btn btn-primary" type="submit">保存内容</button>
                                                <button data-toggle="modal" type="button" class="btn btn-white"
                                                        href="#modal-form">取消
                                                </button>
                                            </div>
                                        </div>
                                        <input id="hidpic2" name="pic" type="hidden" value=""
                                        />
                                        <input id="id" name="id" type="hidden" value=""/>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div th:include="common/footer_js::footer"></div>
    <script>

        //图片上传
        function sendFile(file, editor, $editable) {

            var filename = false;
            try {
                filename = file['name'];
            } catch (e) {
                filename = false;
            }
            if (!filename) {
                $(".note-alarm").remove();
            }
            //以上防止在图片在编辑器内拖拽引发第二次上传导致的提示错误
            data = new FormData();
            data.append("mfile", file);
            data.append("key", filename); //唯一性参数

            $.ajax({
                data: data,
                type: "POST",
                url: "/upload/file?type=sn_GoodsSku",
                cache: false,
                contentType: false,
                processData: false,
                success: function (e) {
                    console.log(e)
                    if (e && e.code != 0) {
                        swal({title: "上传失败", text: "", type: "error"})
                        return;
                    } else {
                        swal({title: "上传成功", text: "", type: "success"})
                    }
                    editor.insertImage($editable, e.data);
                    setTimeout(function () {
                        $(".note-alarm").remove();
                    }, 5000);
                },
                error: function () {
                    swal({title: "上传失败", text: "", type: "error"})
                    return;
                }
            });
        }

        $(document).ready(function () {
            $(".summernote").summernote({
                lang: "zh-CN",
                width: 535,
                height: 260,
                dialogsInBody: true,
                onImageUpload: function (files, editor, $editable) {
                    sendFile(files[0], editor, $editable);
                }
            })
        });
    </script>
    <script src="/js/admin/goodssku.js"></script>
</body>
</html>
